﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.Models;
using SWDataDB.BLL;
using SWDataDB.DAL;
using System.Data;

public partial class AdminManage_add_AddYX : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void submit_Click(object sender, EventArgs e)
    {
        YX_TBL yxobj = new YX_TBL();
        YXInfo kc_in = new YXInfo();

        yxobj.O_ZK_CODE = Request.Form["ZK_CODE"];
        yxobj.O_KT_LCODE = Request.Form["KT_LCODE"];


        yxobj.O_ZK_LONGITUDE = int.Parse((Request.Form["ZK_LONGITUDE_D"] + Request.Form["ZK_LONGITUDE_F"] + Request.Form["ZK_LONGITUDE_M"]));
        yxobj.O_ZK_LATITUDE = int.Parse((Request.Form["ZK_LATITUDE_D"] + Request.Form["ZK_LATITUDE_F"] + Request.Form["ZK_LATITUDE_M"]));


        yxobj.O_ZK_X = Request.Form["ZK_X"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["ZK_X"]));
        yxobj.O_ZK_Y = Request.Form["ZK_Y"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["ZK_Y"]));
        yxobj.O_ZK_H = Request.Form["ZK_H"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["ZK_H"]));

        yxobj.O_ZK_DEPTH = Request.Form["ZK_DEPTH"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["ZK_DEPTH"]));


        yxobj.O_ZK_CORELEN = Request.Form["ZK_CORELEN"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["ZK_CORELEN"]));
        yxobj.O_GC_CORELEN = Request.Form["GC_CORELEN"].Trim().Length == 0 ? 0 : float.Parse((Request.Form["GC_CORELEN"]));

        yxobj.O_ZKYX_COUNT = Request.Form["ZKYX_COUNT"].Trim().Length == 0 ? 0 : int.Parse((Request.Form["ZKYX_COUNT"]));
        yxobj.O_GCYX_COUNT = Request.Form["GCYX_COUNT"].Trim().Length == 0 ? 0 : int.Parse((Request.Form["GCYX_COUNT"]));
        //yxobj.O_IMAGE = float.Parse((Request.Form["IMAGE"];
        yxobj.O_START_DATE = Request.Form["START_DATE"];
        yxobj.O_END_DATE = Request.Form["END_DATE"];
        yxobj.O_ZL_FILE_ID = Request.Form["ZL_FILE_ID"];
        




        if (kc_in.AddYXInfo(yxobj) == 1)
        {
           Response.Write("<script language=javascript>alert('添加成功！');location='../Manage/ZKManage.aspx'</script>");
            //Response.Redirect("ZLManage.aspx");
        }
        else
        {
            Response.Write("<script language=javascript>alert('添加失败！');location='../Manage/ZKManage.aspx'</script>");
        }
    }
}